package iut.acy.cut4u.ihm;

import iut.acy.cut4u.model.FormatDate;

import javax.swing.JTextField;
import javax.swing.JFormattedTextField;
import javax.swing.border.LineBorder;

import java.awt.Color;
import java.awt.event.FocusEvent;
import java.awt.event.FocusListener;
import java.text.DateFormat;
import java.text.ParseException;
import java.util.*;

import java.text.*;

public class JDateFieldObligatoire extends JDateField implements Obligatoire {

	public JDateFieldObligatoire() {
		this(FormatDate.format);

	}

	public JDateFieldObligatoire(String txt) {
		super(txt);
	}

	public GregorianCalendar getGregorianCalendar() {
		return FormatDate.stringToGregorianCalendar(this.getText());

	}

	public boolean estRenseigne() {
		return !(this.getText().equals("") || this.getText().equals(
				FormatDate.format));
	}

}
